#+TITLE: Org mode opened files to org-agenda-files
#+AUTHOR: Zelphir Kaltstahl
#+STARTUP: content
#+STARTUP: indent
#+STARTUP: align
#+STARTUP: inlineimages
#+STARTUP: hideblocks
#+STARTUP: entitiesplain
#+STARTUP: nologdone
#+STARTUP: nologreschedule
#+STARTUP: nologredeadline
#+STARTUP: nologrefile
#+TODO: TODO INPROGRESS | DONE CANCELLED
#+DATE: [2023-01-31 Di]
#+LANGUAGE: English
#+PRIORITIES: A E E
#+KEYWORDS: config hook emacs org-mode agenda org-agenda-files

* About

The following snippet adds all opened org-mode files to the org-agenda-files list. However, consider, that org-agenda already provides a means of for example only looking in the buffer from which it was invoked (=C-c a < m my-tag RET=) and you might not need to add all the opened files to the org-agenda-files.

* Configuration

#+begin_src elisp
(add-hook 'org-mode-hook
          (function
           (lambda ()
             (org-agenda-file-to-front))))
#+end_src
